import requests
import unittest
from parameterized import parameterized
from api.Ihrm_api import IhrmApi
from common.r_json import r_json
from common.assert_login import assert_login_util


class TestIhrmLogin(unittest.TestCase):
    session = None

    def setUp(self) -> None:
        self.session = requests.Session()

    @parameterized.expand(r_json("login_data.json"))
    def test01_login(self, log_data, assert_data):
        resp_login = IhrmApi.login(self.session, log_data)
        print(resp_login.json())
        assert_login_util(self, resp_login, *assert_data)
